package com.tingyuge.base.design.proxy.proxy;

import java.lang.reflect.Proxy;

/**
 * @Created by xiaodao
 */
public class Client {

    public static void main(String[] args) {
        Star star = new RealStar();
        StarHandler handler = new StarHandler(star);

      Star proxyInstance  =(Star)Proxy.newProxyInstance(ClassLoader.getSystemClassLoader(),new Class[]{Star.class},handler);

      proxyInstance.sing();
      proxyInstance.collectMoney();
    }
}
